<!DOCTYPE html>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>

<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jsp:include page="/common/commonCss.jsp"/>
<script  type="text/javascript" src="${basePath }commonJs/jquery.min.js"></script>
<script  type="text/javascript" src="${basePath }commonJs/jquery.easyui.min.js"></script>
<!-- 统一提示js -->
<script  type="text/javascript" src="${basePath }commonJs/message.js"></script>
<script  type="text/javascript" src="${basePath }commonJs/jt_map.js"></script>
<script  type="text/javascript" src="${basePath }commonJs/jt_normal.js"></script>
  
<script src="${basePath}commonJs/jquery.imageScroller.js"></script> 
<link rel='stylesheet' href='${basePath}commonCss/css/fullcalendar-tuanti.css'  />
<link rel='stylesheet' media='print'  href='${basePath}commonCss/css/fullcalendar.print-tuanti.css' />
<link rel="stylesheet"   type="text/css" href="${basePath}commonCss/css/baseDatePicker/ui.all.css" />
<script type="text/javascript">
var roomArray=null;
var fangArray=[];
var basePath ='${basePath}';
var fanglength =0;
var baseLocalPath='${basePath }';
//var jiawu=new Array("0wufang-","1tangguo-","2tuhua-","3qixiu-","4gongneng-");//声明 房屋类型 数组 4657
$(document).ready(function() {
	getparRoomList();
	  roomArray= new   Array();    
	<c:forEach items="${listRoom}" var="parRoom" varStatus="status">
	  roomArray['${status.index}']='${parRoom.roomName}-';
	</c:forEach>
	  fanglength =roomArray.length;
	var customerDate ='${dateNow}';
			$('#calendar').fullCalendar('destroy');
	renderCalendar(customerDate);
	// refreshSelect();
});

function getparRoomList(){
	 var url ='${basePath }parreserve/findParReserveRooMList.shtml';
	$.ajax({
		   url: url,
		   type: 'POST',
		   data:$("#form1").serialize(),//序列化表单里所有的内容
		   async:false, 
		   error : function(XMLHttpRequest) {
			   ajaxError(XMLHttpRequest);
			   },
		   success:function(data){
				if (data != null) {
					var jsonarray ;
					var parStatus=new Array("未预付","自动取消","取消","待确认","已确认","进行中","完成","删除");
					fangArray=[];
					 for(var o in data){ 
						 if(o=="gblparResRoomMap"){
							 jsonarray=data[o];
							// var obj = str.parseJSON(); start: '2014-06-12T10:00:00',
					//end: '2014-06-12T12:00:00'
							
							 for (var k = 0; k < jsonarray.length; k++){
								 fangArray.push();
								 var jsonobj = jsonarray[k];
								 var subject=jsonobj["subject"];
								 var conName=jsonobj["conName"];
								 if(conName==null){
									 conName ="";
								 }
								 if(subject==null){
									 subject ="";
								 }
								 if(subject.length>12){
									 subject =subject.substring(0,12)+"...";
								 }
								  
								 if(conName.length>12){
									 conName =conName.substring(0,12)+"...";
								 }
								 var statusInt=jsonobj["resStatus"];
								 var parStatusName=parStatus[statusInt-1];
								 var fangid=jsonobj["roomName"]+"-"+jsonobj["roomId"]+"@"+jsonobj["lockFlag"];
								 var partitle=jsonobj["roomName"]+"-"+parStatusName+"\n"+subject+"\n"+conName+" "+jsonobj["conMobile"];
								 var parStart=jsonobj["presDay"]+"T"+jsonobj["resTimeS"];
								 var parEnd=jsonobj["presDay"]+"T"+jsonobj["resTimeE"];
								 var testJson = { "id": fangid, "title":partitle,"start":parStart,"end":parEnd};
								 fangArray.push(testJson);
								  
							 }
							 
						 }
					 }
				}else{
					 $.messager.alert('提示','加载预约房间失败！','error');
				}
		   }
		  });
}
</script>
<script  type="text/javascript" src='${basePath}commonJs/lib/moment.min.js'></script>
<script  type="text/javascript" src='${basePath}commonJs/lib/jquery-ui.custom.min.js'></script>
<script  type="text/javascript" src='${basePath}commonJs/fullcalendar_tuanti.js'></script>
<script  type="text/javascript" src='${basePath}commonJs/lang-all.js'></script>
<script  type="text/javascript" src='${basePath}commonJs/jquery.fancybox-1.3.1.pack.js'></script>
<script type="text/javascript" src="${basePath}commonJs/ui/ui.core.js"></script>
<script type="text/javascript" src="${basePath}commonJs/ui/ui.datepicker.js"></script>
<script type="text/javascript" src="${basePath}commonJs/ui/ui.datepicker-zh-CN.js"></script>
<script type="text/javascript" src="${basePath}commonJs/jquery.form.min.js"></script>
<script type="text/javascript"  src="${basePath}commonJs/jt_normal.js"></script>
<script type="text/javascript" src="${basePath}commonJs/order_group.js"></script>
<script type="text/javascript" src="${basePath}commonJs/calendar.js"></script>
<title>派对/团体预约</title>
</head>
<body class="bg">
 <form action="" id="form1">
   <input type="hidden" name="resStatus" id="resStatus" value="1456" > <!-- 新增 预约 的 日期控件 只显示 状态 为 1，4，5，6的 数据 -->
 </form>

<div class="content m_auto ">
	<div class="content_l mt10">
    	<ul>
       	   <shiro:hasPermission name="membership/single/jumpSingleTicket.shtml">
        	<li><a href="${basePath }membership/single/jumpSingleTicket.shtml"><i class="nav_icon_a"></i><br>单次票</a></li>
		</shiro:hasPermission>
		<shiro:hasPermission name="membership/member/jumpMember.shtml">
			<li><a href="${basePath }membership/member/jumpMember.shtml"><i class="nav_icon_b"></i><br>会籍</a></li>
		</shiro:hasPermission>
		<shiro:hasPermission name="membership/visitor/jumpVisitor.shtml">
			<li><a href="${basePath }membership/visitor/jumpVisitor.shtml"><i class="nav_icon_d"></i><br>访客</a></li>
		</shiro:hasPermission>
		<shiro:hasPermission name="parreserve/loadParReserve.shtml">
			<li class="content_hover"><a href="${basePath }parreserve/loadParReserve.shtml"><i class="nav_icon_g"></i><br>派对/团体预约</a></li>
        </shiro:hasPermission>
        </ul>
    </div>
    <div class="content_r mt10">
    	 
         <div id='calendar' class="data_l m10"></div>
        <div class="data_r mt10" id="calendarInput"></div>
    </div>
</div>
</body>

</html>
















